﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FonShare.Classes;
using FonShare.Classes.Data;
using FonShare.Classes.FTP;
using Coolite.Ext.Web;
using FonShare.Classes.Coolite;

namespace FonShare.WebPages
{
    public partial class TransferFiles : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int userId = (int)Session[FS_Constants.Session.USERID];
                Dictionary<string, List<FS_FTPFile>> sharedFiles = new Dictionary<string, List<FS_FTPFile>>();
                try
                {
                    sharedFiles = FS_FTPManager.GetSharedFilesList(userId);
                }
                catch (Exception ex)
                {
                    MessageLabel.Text = "Error during connection to Servers, please check your server configuration or try again.";
                }
                //SharedFilesListBox.DataSource = sharedFiles;
                //SharedFilesListBox.DataBind();
                TreePanel tree = new TreePanel();
                SharedFilesPlaceHolder.Controls.Add(tree);
                FS_TreeBuilder.BuildFilesTreePanel(tree, "Shared Files", sharedFiles);
            }
        }

        protected void TransferFilesButton_Click(object sender, EventArgs e)
        {

        }
    }
}
